package com.sokal.easycare.modules.kpoint.entity.activity;

import org.hibernate.validator.constraints.Length;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;

import javax.validation.constraints.NotNull;

import com.sokal.easycare.common.persistence.DataEntity;
import com.sokal.easycare.modules.kpoint.entity.KPointMain;
import com.sokal.easycare.modules.sys.entity.Area;

/**
 * 体验店活动Entity
 * @author lihaipei
 * @version 2017-03-18
 */
public class KPointActivity extends DataEntity<KPointActivity> {

	/** 记录维护状态0：已结束 */
	public static final String STATUS_END = "0";
	/** 记录维护状态1：进行中 */
	public static final String STATUS_ONGOING = "1";
	/** 记录维护状态2：未开启 */
	public static final String STATUS_NOT_OPEN = "2";
	private static final long serialVersionUID = 1L;
	private String title;		// 活动标题
	private String fullAddress;		// 详细地址
	private String status;		// 状态 - 2未开启 1进行中 0已结束
	private Date startTime;		// 开始时间
	private Date endTime;		// 结束时间
	private String type;		// 类型-0非直播类活动 1直播类活动
	private String linkUrl;		// 链接地址
	private KPointMain kPointMain;		// 体验店
	private String imageUrl; //封面图
	private List<KPointActivityFile> activityFiles = Lists.newArrayList(); //封装图片集
	private Area activityArea; //活动位置
	
	public KPointActivity() {
		super();
	}

	public KPointActivity(String id){
		super(id);
	}

	@Length(min=1, max=100, message="活动标题长度必须介于 1 和 100 之间")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Length(min=1, max=255, message="详细地址长度必须介于 1 和 255 之间")
	public String getFullAddress() {
		return fullAddress;
	}

	public void setFullAddress(String fullAddress) {
		this.fullAddress = fullAddress;
	}
	
	@Length(min=0, max=1, message="状态 - 2未开启 1进行中 0已结束长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始时间不能为空")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结束时间不能为空")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	@Length(min=1, max=1, message="类型-0非直播类活动 1直播类活动长度必须介于 1 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=0, max=255, message="链接地址长度必须介于 0 和 255 之间")
	public String getLinkUrl() {
		return linkUrl;
	}

	public void setLinkUrl(String linkUrl) {
		this.linkUrl = linkUrl;
	}

	@JsonIgnore
	//@NotNull(message="体验店名称不能为空")
	public KPointMain getkPointMain() {
		return kPointMain;
	}

	public void setkPointMain(KPointMain kPointMain) {
		this.kPointMain = kPointMain;
	}

	@Length(min=0, max=255, message="封面效果图路径长度必须介于0和255之间")
	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public List<KPointActivityFile> getActivityFiles() {
		return activityFiles;
	}

	public void setActivityFiles(List<KPointActivityFile> activityFiles) {
		this.activityFiles = activityFiles;
	}

	public Area getActivityArea() {
		return activityArea;
	}

	public void setActivityArea(Area activityArea) {
		this.activityArea = activityArea;
	}
	
}